<script type="text/javascript" src="/js/jquery-1.8.3.min.js"></script>
<link href="/css/bootstrap.min.css" rel="stylesheet"/> 
<link href="/templates/admin/css/admin_default.css" rel="stylesheet"/>
<link href="/css/jquery.tagit.css" rel="stylesheet"/>
<link href="/css/tagit.ui-zendesk.css" rel="stylesheet"/> 
<script type="text/javascript" src="/js/jquery-ui.js"></script>
<script type="text/javascript" src="/js/tag-it.js"></script>
<script type="text/javascript" src="/js/select-chain.js"></script>

<link href="/css/bootstrap.min.css" rel="stylesheet"/> 
<script>
$(document).ready(function(){
    
    var sampleTags = [ 'tin tuc','news','tin hot','phim','ca nhac', 'youtube'];
    $('#key').tagit({
        availableTags: sampleTags,
        allowSpaces: true
    }); 
})
</script>
<?php if($this->error){ ?>
	<div class="notification error" >
		<span class="strong">Error:</span>
		<?php echo $this->error; ?>.
		<span class="close" title="Dismiss"></span>
	</div>
<?php }?>
<?php if($this->warning){ ?>
	<div class="notification warning" >
		<span class="strong">Warning:</span>
		<?php echo $this->warning; ?>
		<span class="close" title="Dismiss"></span>
	</div>
<?php }?>

<?php $item = $this->object; ?>


<form name="editor" action="" method="post" enctype="application/x-www-form-urlencoded">     
<div id="main-content">
<div class="news-content">
    <label>Trạng thái:</label>
      <div>
               <select name="status">
                <option value="1" >ON</option>
                <option value="0" >OFF</option>
                </select>
            </div>
</div>
<div class="news-content">
    <label>Tiêu đề bài viết:</label>
    <input type='text' name="title" value="<?php echo $item['title'] ?>"/>
</div>
<div class="news-content">
    <label>Tiêu đề Seo:</label>
    <input type='text' name="title_seo" value="<?php echo $item['title_seo'] ?>"/>
</div>
<div class="news-content">
    <label>
    Nguồn *
    </label>
    <input type="text"  id="source" name="source" value="<?php echo stripslashes(@$item['source']);?>" required="required"/>
</div>
<div class="news-content">
    <label>Chọn ảnh:</label>
    <input type="text" value="<?php echo $item['thumb'];?>" id="urlSelectImg" name="urlSelectImg" style="display: none;" />
    <input type="button" value="Upload" id="btnSelectImg" name="btnSelectImg" class="btn btn-success" />
    <div id="displayImages"><img height=72 width=72 class='images' src="<?php echo @$item['thumb'];?>"/></div>
</div>

<div class="news-content">
    <label>Mô tả bài viết:</label>
    <textarea  id="description" name="description"><?php echo stripslashes($item['description']);?></textarea>
</div>
<div class="news-content">
    <label>Keyword: </label>
    <ul id="key">
        <?php if(@$item['keyword']){
        $key = explode(',',@$item['keyword']);
        for($i = 0; $i < count($key);$i++)
        echo "<li>".$key[$i]."</li>"; 
        }
        ?>
    </ul>
</div>
<div class="mo-ta">
    <label>Nội dung bài viết:</label>
    <textarea  id="content" name="content"><?php echo stripslashes($item['content']);?></textarea>
</div>
<div class="news-content">
    <input type="submit" value="Ðăng bài" class="btn btn-success"/>
</div>
</div>
</form>
 <script>
               CKEDITOR.replace('content',{
                   fullpage:true,
                   extraPlugins:'docprops',
                   skin:'office2003',
                   
                   extraPlugins : 'autogrow',
	               autoGrow_maxHeight : 600,
                   removePlugins : 'resize'
               });
 </script>
 
 